package com.wanlian.vo;


import com.wanlian.entity.StorageItem;
import com.wanlian.json.JsonStringUtil;
import com.wanlian.util.StringUtil;

import  java.util.List;

//用于接收文件信息
public class DeviceFileVo {
    private String md5;
    private List<StorageItem>items;
    private String itemstr;

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public List<StorageItem> getItems() {
        return items;
    }

    public void setItems(List<StorageItem> items) {
        this.items = items;
    }

    public String getItemstr() {
        return itemstr;
    }

    public void setItemstr(String itemstr) {
        this.itemstr = itemstr;
    }

    public void transferToItems(){
        if(items==null|| items.size()==0){
            if(StringUtil.hasValue(this.itemstr)){
                List<StorageItem>items= JsonStringUtil.readValueByList(this.itemstr,StorageItem.class);
                this.setItems(items);
            }
        }
    }
}
